package com.hongye.backstage.service.impl;

import com.hongye.backstage.dao.HongyeCityDao;
import com.hongye.backstage.entity.HongyeCityEntity;
import com.hongye.backstage.service.HongyeCityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author caojianbin
 * @time 2022/4/25
 */
@Service
public class HongyeCityServiceImpl implements HongyeCityService {
    @Autowired
    private HongyeCityDao hongyeCityDao;

    @Override
    public List<HongyeCityEntity> findCityByPid(Integer pid) {
        return hongyeCityDao.findCityByPid(pid);
    }

    /**
     * 根据父级编号查询省市区
     * @param pid 父级编号
     * @return
     */
    @Override
    public List<HongyeCityEntity> getCityByPid(Integer pid) {
        return hongyeCityDao.selectByPid(pid);
    }
}
